{% extends 'base_form.html' %}
{% block title %} Meeting Planner {% endblock %}

{% block jscript %}
<script>
$(document).ready(function() {

    // page is now ready, initialize the calendar...


	$.ajax({
		url: "/ws/getAllEventData",
		dataType: 'json',
		success: function(calEvents){
			var eventSet = calEvents; 
			$('#calDiv').fullCalendar({
				header: {
				left:'prev,next,today',
				center: 'title',
				right: 'month,agendaWeek,agendaDay'
				},
				events: eventSet
			});
			
	   	},
	});
	

	

	
	
	
	
	
	
	
	/*
	$.ajax({
		url: "/ws/getAllEventData",
		//dataType: 'json',
		success: function(events){
			alert("Got these events \n "+ events);
		}
		});
	$('#calDiv').fullCalendar({
				header: {
				left:'prev,next,today',
				center: 'title',
				right: 'month,basicWeek,basicDay'
				},
				events:  [{"url": "/ws/eventDetail?mid=1", "start": 1314738900, "end": 1314739095, "title": "Test Creating An event into the new system "}, {"url": "/ws/eventDetail?mid=2", "start": 1312291800, "end": 1312292010, "title": "Time Machine 1"}, {"url": "/ws/eventDetail?mid=3", "start": 1317216600, "end": 1317216840, "title": "Future is Bright"}, {"url": "/ws/eventDetail?mid=4", "start": 1314172800, "end": 1314173040, "title": "New Early Event "}, {"url": "/ws/eventDetail?mid=5", "start": 1314833400, "end": 1314833820, "title": "New Event Foo"}, {"url": "/ws/eventDetail?mid=7", "start": 1312891200, "end": 1312891260, "title": "TRANSACTION"}, {"url": "/ws/eventDetail?mid=8", "start": 1314792000, "end": 1314792060, "title": "New Meeting"}, {"url": "/ws/eventDetail?mid=9", "start": 1314360000, "end": 1314360060, "title": "NO ME"}, {"url": "/ws/eventDetail?mid=10", "start": 1314532800, "end": 1314532860, "title": "New With ME"}, {"url": "/ws/eventDetail?mid=12", "start": 1314100800, "end": 1314100860, "title": "Victory IS Mine"}]
				
			
	})

	var date = new Date();
	var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();

	var test = new Date(y, m, d, 12, 0);
	//alert("Date = " + test)
		*/
	/*
    $('#calDiv').fullCalendar({
		header: {
			left:'prev,next,today',
			center: 'title',
			right: 'month,agendaWeek,agendaDay'
	   	},
		
		eventSources: [ 
				{
					url: "/ws/getEventData",
					data: {}
				}
			]
			
		

		events: [
        {
            title  : 'event1',
            start  : '2011-08-09 12:30:00',
			end: '2011-08-09 16:30:00',
			allDay: false

        },
		{
            title  : 'event TS',
            start  : '1314738900',
			end: '1314739095',
			allDay: false

        },
		{
            title  : 'event2',
            start  : 1317216600,

        },
		{
            title  : 'event3',
            start  : '1317216600',
			color: 'green',   // a non-ajax option
            textColor: 'black' // a non-ajax option
        },
		{
            title  : 'event4',
            start  : '1317216600',
			color: 'red',   // a non-ajax option
            textColor: 'black' // a non-ajax option
        }


    	]
		
		
    })
	*/
	// load tab control
	$( "#tabs" ).tabs();
	$( "#subTabs" ).tabs();
	
	$("#userNameDiv").hide();
	$("#userNameDiv").fadeIn(2000);

});

/*
$(function() {
	$( "#tabs" ).tabs();
});
*/
</script>

{% endblock %}


{% block ctrlContent %}
<div id="tabs">
	<ul>
		<li><a href="#tabs-1" id="tabl-1">Events</a></li>
		<li><a href="#tabs-2" id="tabl-2">Schedule</a></li>
		
		{%if sess_admin == 1 %}
			<li><a href="#tabs-3" id="tabl-3">Admin</a>

			</li>
	{% endif%}
	</ul>
	
	<div id="tabs-1">
		<div id="tab1Div" class="tabClass">
		{% include 'events.html' %}
		</div>
	</div>
	
	<div id="tabs-2">
		<div id="tab1Div" class="tabClass">
		{% include 'schedule.html' %}
		</div>
	</div>
	

	{% if sess_admin == 1 %}
		<div id="tabs-3">
			
			
			<div id="tab1Div" class="tabClass">
				{% include 'admin.html' %}

			</div>
		</div>
		
	{% endif%}


</div>


{% endblock %}


{% block bannerMsg %}
<div id='userNameDiv'><a href="/doLogout">Logout</a> </div>
<div id='userNameDiv'><b>Welcome: </b>  {{sess_fullname}} </div>

{% endblock %}

